package com.ppp.poi.common.exception;

import com.ppp.poi.bean.enumeration.RES_STATUS;
import lombok.Data;

/**
 * @author Wu Jin
 * @create 2019-07-29
 */
@Data
public class AppException extends RuntimeException {

  protected int code;
  protected String msg;

  public AppException() {
    super();
  }

  public AppException(int code, String msg) {
    super(msg);
    this.code = code;
    this.msg = msg;
  }

  public AppException(RES_STATUS info) {
    super(info.msg);

    this.code = info.code;
    this.msg = info.msg;
  }

  public AppException(String msg) {
    super(msg);

    this.code = RES_STATUS.SERVER_UNKONW_ERROR.code;
    this.msg = msg;
  }

}
